Within the field of computing, many scenarios involve an execution of applications within virtual environments of a device, such as web applications executing within a web browser; code that is developed for a computational environment other than that provided by the device (e.g., Java code designed for a Java virtual machine); and untrusted code executing within an isolated virtual machine. The execution of the application within the virtual machine, rather than as a native process of the device, may facilitate the compatibility and security of the application during execution.
Such applications often involve background processing, such as long-running, computationally intensive processes. For example, an application may seek to monitor hardware components of the device for a particular type of event, such as an incoming call on a mobile phone. However, if such processing is performed by the application, other responsibilities of the application may be undesirably delayed; e.g., computationally intensive processing may preempt the handling of graphical user interface (GUI) messages, and may cause the application to present reduced interactivity or performance. In order to achieve such background processing while reducing interruption of other processing responsibilities of the application, the application may invoke one or more worker processes within the virtual environment. For example, the “web workers” model provided in recent versions of the Hypertext Markup Language (HTML) enables applications to request the web browser to initiate separate worker processes within the web browser, thus achieving background processing on behalf of the application in a secured and performant manner.